package com.yuyuan.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.yuyuan.dao.PlantMapper;
import com.yuyuan.domain.Category;
import com.yuyuan.domain.Plant;

@Service
public class PlantServiceImpl implements PlantService{
	@Autowired
	private PlantMapper plantMapper;
	@Override
	public PageInfo<Plant> list(Plant plant, Integer pageNum, Integer pageSize) {
		// TODO Auto-generated method stub
		PageHelper.startPage(pageNum,pageSize);
		List<Plant> list=plantMapper.list(plant);
		return new PageInfo<Plant>(list);
	}
	@Override
	public List<Category> getCategorys() {
		// TODO Auto-generated method stub
		return plantMapper.getCategorys();
	}
	@Override
	public int add(Plant plant) {
		// TODO Auto-generated method stub
		return plantMapper.add(plant);
	}
	@Override
	public Plant get(Integer id) {
		// TODO Auto-generated method stub
		return plantMapper.get(id);
	}
	@Override
	public int update(Plant plant) {
		// TODO Auto-generated method stub
		return plantMapper.update(plant);
	}
	@Override
	public int deleteBatch(Integer[] ids) {
		// TODO Auto-generated method stub
		return plantMapper.deleteBatch(ids);
	}
	
}
